void __attribute__((naked,noinline)) sub_FFC5DCA0_my(){
asm volatile(
                 "LDR     R12, =0x201E\n"
                 "STMFD   SP!, {R4,LR}\n"
                 "CMP     R0, R12\n"
                 "BEQ     loc_FFC5DD60\n"
                 "BGT     loc_FFC5DCFC\n"
                 "LDR     R12, =0x2004\n"
                 "CMP     R0, R12\n"
                 "BEQ     loc_FFC5DD68\n"
                 "BGT     loc_FFC5DCE4\n"
                 "SUB     R12, R0, #0x1000\n"
                 "SUBS    R12, R12, #0xA9\n"
                 "SUBNE   R12, R0, #0x1000\n"
                 "SUBNES  R12, R12, #0xAD\n"
                 "SUBNE   R12, R0, #0x1000\n"
                 "SUBNES  R12, R12, #0xAF\n"
                 "BNE     loc_FFC5DD78\n"
                 "B       loc_FFC5DD60\n"
 "loc_FFC5DCE4:\n"
                 "SUB     R12, R0, #0x2000\n"
                 "SUBS    R12, R12, #5\n"
                 "SUBNE   R12, R0, #0x2000\n"
                 "SUBNES  R12, R12, #0x1D\n"
                 "BNE     loc_FFC5DD78\n"
                 "B       loc_FFC5DD60\n"
 "loc_FFC5DCFC:\n"
                 "LDR     R12, =0x5004\n"
                 "CMP     R0, R12\n"
                 "BEQ     loc_FFC5DD60\n"
                 "BGT     loc_FFC5DD28\n"
                 "SUB     R12, R0, #0x3000\n"
                 "SUBS    R12, R12, #0xA\n"
                 "BEQ     loc_FFC5DD5C\n"
                 "SUB     R12, R0, #0x5000\n"
                 "SUBS    R12, R12, #1\n"
                 "BNE     loc_FFC5DD78\n"
                 "B       loc_FFC5DD60\n"
 "loc_FFC5DD28:\n"
                 "SUB     R12, R0, #0x5000\n"
                 "SUBS    R12, R12, #6\n"
                 "BEQ     loc_FFC5DD60\n"
                 "SUB     R12, R0, #0x5000\n"
                 "SUBS    R12, R12, #7\n"
                 "BNE     loc_FFC5DD78\n"
                 "BL      sub_FFC1A5F4\n"
                 "LDR     R1, =0x5788\n"
                 "LDR     R0, [R1,#0x10]\n"
                 "CMP     R0, #7\n"
                 "LDREQ   R0, [R1,#0x18]\n"
                 "BLEQ    sub_FFC5E610\n"
                 "B       loc_FFC5DD70\n"
 "loc_FFC5DD5C:\n"
                 "BL      sub_FFC19B88\n"
 "loc_FFC5DD60:\n"
                 "LDMFD   SP!, {R4,LR}\n"
                 "B       sub_FFC5DB00_my\n" //------------->
 "loc_FFC5DD68:\n"
                 "BL      sub_FFC5CB90\n"
                 "BL      sub_FFC5D5B4\n"
 "loc_FFC5DD70:\n"
                 "MOV     R0, #0\n"
                 "LDMFD   SP!, {R4,PC}\n"
 "loc_FFC5DD78:\n"
                 "MOV     R0, #1\n"
                 "LDMFD   SP!, {R4,PC}\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC5DB00_my(){
asm volatile(
                 "STMFD   SP!, {R4-R6,LR}\n"
                 "BL      sub_FFC5E77C\n"
                 "CMP     R0, #1\n"
                 "BLEQ    sub_FFC5E864\n"
                 "LDR     R4, =0x5788\n"
                 "MOV     R5, #1\n"
                 "LDR     R0, [R4,#0x24]\n"
                 "CMP     R0, #0\n"
                 "LDRNE   R0, [R4,#0x4C]\n"
                 "CMPNE   R0, #0\n"
                 "BEQ     loc_FFC5DB6C\n"
                 "BL      sub_FFC5E77C\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FFC5DB6C\n"
                 "BL      sub_FFC5E864\n"
                 "LDR     R0, [R4,#0x78]\n"
                 "CMP     R0, #0\n"
                 "BNE     loc_FFC5DB6C\n"
                 "LDR     R1, =0xFFC5DC80\n"
                 "MOV     R0, #0x20\n"
                 "BL      sub_FFC547F4\n"
                 "BL      sub_FFD6790C\n"
                 "BL      sub_FFD6789C\n"
                 "MOV     R1, #0\n"
                 "MOV     R0, #0x51\n"
                 "BL      sub_FFC65ED0\n"
                 "STR     R5, [R4,#0x78]\n"
 "loc_FFC5DB6C:\n"
                 "BL      sub_FFC5E77C\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FFC5DBB8\n"
                 "LDR     R0, [R4,#0x44]\n"
                 "CMP     R0, #0\n"
                 "BEQ     loc_FFC5DBB8\n"
                 "LDR     R0, [R4,#0x74]\n"
                 "CMP     R0, #0\n"
                 "BNE     loc_FFC5DBB8\n"
                 "LDR     R1, =0xFFC5DC94\n"
                 "MOV     R0, #0x20\n"
                 "BL      sub_FFC547F4\n"
                 "MOV     R1, #0\n"
                 "MOV     R0, #0x8C\n"
                 "BL      sub_FFC65ED0\n"
                 "BL      sub_FFC640BC\n"
                 "MOV     R0, #0x21\n"
                 "BL      sub_FFC65F10\n"
                 "STR     R5, [R4,#0x74]\n"
 "loc_FFC5DBB8:\n"
                 "LDR     R0, [R4,#0x38]\n"
                 "CMP     R0, #0\n"
                 "LDRNE   R0, [R4,#0x3C]\n"
                 "CMPNE   R0, #0\n"
                 "LDRNE   R0, [R4,#0x44]\n"
                 "CMPNE   R0, #0\n"
                 "LDRNE   R0, [R4,#0x48]\n"
                 "CMPNE   R0, #0\n"
                 "LDRNE   R0, [R4,#0x1C]\n"
                 "LDRNE   R1, [R4,#0x20]\n"
                 "ORRNES  R0, R0, R1\n"
                 "BEQ     loc_FFC5DBF4\n"
                 "BL      sub_FFC5D454\n"
                 "BL      sub_FFC5D5B4\n"
                 "B       loc_FFC5DC1C\n"
 "loc_FFC5DBF4:\n"
                 "LDR     R0, [R4,#0x58]\n"
                 "CMP     R0, #0\n"
                 "BEQ     loc_FFC5DC24\n"
                 "BL      sub_FFC5D49C\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FFC5DC24\n"
                 "BL      sub_FFC5FE40\n"
                 "BL      sub_FFC5FDFC\n"
                 "MOV     R0, #0\n"
                 "BL      sub_FFC5E64C\n"
 "loc_FFC5DC1C:\n"
                 "MOV     R0, #0\n"
                 "LDMFD   SP!, {R4-R6,PC}\n"
 "loc_FFC5DC24:\n"
                 "BL      sub_FFC5D49C\n"
                 "CMP     R0, #1\n"
                 "BNE     loc_FFC5DC4C\n"
                 "LDR     R0, [R4,#0x7C]\n"
                 "CMP     R0, #0\n"
                 "BLEQ    sub_FFC5E8A8_my\n" //------------->
                 "MOV     R0, #0\n"
                 "STR     R0, [R4,#0x70]\n"
                 "STR     R0, [R4,#0x74]\n"
                 "STR     R0, [R4,#0x78]\n"
 "loc_FFC5DC4C:\n"
                 "MOV     R0, #1\n"
                 "LDMFD   SP!, {R4-R6,PC}\n"
);
}

void __attribute__((naked,noinline)) sub_FFC5E8A8_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC5EAC8\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC547F4\n"
                "BL      sub_FFC19DA4\n"
                "BL      sub_FFC5EBCC\n"
                "BL      sub_FFC61EC4_my\n" //------------->
                "MOV     R0, #1\n"
                "BL      sub_FFC5CF30\n"
                "BL      sub_FFC5D3D8\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC5D648\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC61EC4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R1, =0xFFC620D0\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC547F4\n"
                "LDR     R4, =0x5A10\n"
                "MOV     R0, #6\n"
                "MOV     R5, #1\n"
                "STR     R0, [R4,#0x5C]\n"
                "STR     R5, [R4,#0x10]\n"
                "BL      sub_FFD2B218\n"
                "BL      sub_FFD310D0\n"
                "BL      sub_FFD2F8B8\n"
                "BL      sub_FFC622E4_my\n"  //------------->
                "BL      sub_FFD389D4\n"
                "MOV     R0, #1\n"
                "STR     R5, [R4,#0x18]\n"
                "BL      sub_FFC6237C\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x60]\n"
                "LDR     R1, [R4,#0x64]\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC622E4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x855\n"
                "BL      sub_FFD27A74\n"
                "BL      sub_FFC19B88\n"
				"BL      sub_FFC61C80\n"
                "BL      sub_FFC61C80_my\n"  //-------------->
                "BL      sub_FFD2AB28\n"
                "BL      sub_FFD1B170\n"
                "BL      sub_FFD32EFC\n"
                "BL      sub_FFD332EC\n"
                "BL      sub_FFD33504\n"
                "BL      sub_FFD33074\n"
                "BL      sub_FFD3180C\n"
                "BL      sub_FFC65FB0\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC65DE0\n"
 );
} 

// branches are together

void __attribute__((naked,noinline)) sub_FFC61C80_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R0, =0x5A78\n"
                "LDR     R1, =sub_FFC61A50_my\n" //------------->
                "BL      sub_FFC66764\n"
                "LDR     R1, =0x5A10\n"
                "LDR     R0, =sub_FFC61B74_my\n" //------------->
                "STR     R0, [R1,#0x64]\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

//branch 1

void __attribute__((naked,noinline)) sub_FFC61A50_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R5,LR}\n"
                "LDR     R4, =0x5A10\n"
				"LDR     R0, [R4,#0x3C]\n"
				"CMP     R0, #0\n"
				"BLEQ    sub_FFD19ECC\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC61A90\n"
                "LDR     R1, =0xFFC61B54\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC547F4\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "STR     R0, [R4,#0x2C]\n"
                "BL      sub_FFC61960\n"
                "LDMFD   SP!, {R3-R5,PC}\n"
"loc_FFC61A90:\n"
                "BL      sub_FFC15500\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, SP\n"
                "STRH    R0, [SP,#0x10-0x10]\n"
                "LDR     R0, [R4,#0x5C]\n"
                "STRH    R0, [SP,#0x10-0xE]\n"
                "MOV     R0, #0x40\n"
                "BL      sub_FFC65ED0\n"
                "LDR     R0, [R4,#0x1C]\n"
                "CMP     R0, #0\n"
                "LDREQH  R0, [R4,#4]\n"
                "BLEQ    sub_FFC5C2AC\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #1\n"
                "BL      sub_FFC60D70_my\n" //----------->
                "LDR     R0, [R4,#0x60]\n"
                "BL      sub_FFC6237C\n"
                "MOV     R0, #3\n"
                "STR     R0, [R4,#0x60]\n"
                "LDR     R1, [R4,#0x64]\n"
                "ADD     SP, SP, #4\n"
                "LDMFD   SP!, {R4,R5,LR}\n"
                "MOV     R0, #0\n"
                "BX      R1\n"
 );
} 

//branch 2

void __attribute__((naked,noinline)) sub_FFC61B74_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R0, =0x8009\n"
                "BL      sub_FFC5C3D4\n"
                "LDR     R4, =0x826\n"
                "CMP     R0, #0xB\n"
                "CMPNE   R0, #0xC\n"
                "MOV     R0, R4\n"
                "BNE     loc_FFC61B9C\n"
				"BL      sub_FFD2793C\n"
				"B       loc_FFC61BAC\n"
"loc_FFC61B9C:\n"
                "BL      sub_FFD27B7C\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, R4\n"
				"BLNE    sub_FFD27A74\n"
"loc_FFC61BAC:\n"
                "LDR     R4, =0x5A10\n"
                "LDRH    R0, [R4,#4]\n"
                "BL      sub_FFD31308\n"
                "BL      sub_FFD2FA78\n"
                "BL      sub_FFD33594\n"
             // "BL      nullsub_70\n"
                "BL      sub_FFD31998\n"
				"BL      sub_FFD1CEC0\n"
                "MOV     R5, #0\n"
                "MOV     R0, R5\n"
                "STR     R5, [R4,#0x24]\n"
                "BL      sub_FFC155E4\n"
				"BL      sub_FFD1C5C0\n"
                "STR     R5, [R4,#0x3C]\n"
                "LDRH    R0, [R4,#4]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC60D70_my\n" //----------->
                "BL      sub_FFC640BC\n"
                "LDR     R1, [R4,#0x5C]\n"
                "MOV     R0, #0x41\n"
                "BL      sub_FFC65ED0\n"
                "BL      sub_FFD2FA68\n"
                "BL      sub_FFD2B38C\n"
                "CMP     R0, #0\n"
                "BLEQ    sub_FFD2FA7C\n"
                "BL      sub_FFD31290\n"
                "BL      sub_FFD19D3C\n"
                "BL      sub_FFC5A6BC\n"
                "STR     R0, [R4,#0x58]\n"
                "LDR     R0, =0x8003\n"
                "STR     R5, [R4,#0x2C]\n"
                "BL      sub_FFC5C3D4\n"
                "STRH    R0, [R4]\n"
                "LDR     R0, =0x313D\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5B140\n"
                "BL      sub_FFC62280\n"
                "LDR     R0, [R4,#0x30]\n"
                "CMP     R0, #1\n"
                "STREQ   R5, [R4,#0x30]\n"
                "LDMEQFD SP!, {R4-R6,LR}\n"
                "BEQ     sub_FFC61960\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
} 

//branches are joining here

void __attribute__((naked,noinline)) sub_FFC60D70_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "MOV     R5, R1\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x60\n"
                "LDR     R1, =0xFFC61040\n"
                "BL      sub_FFC547F4\n"
                "LDR     R6, =0x5A10\n"
                "LDR     R0, [R6,#0x10]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC60E9C\n"
                "LDR     R0, [R6,#0x18]\n"
                "LDR     R2, =0x820A\n"
                "LDR     R1, =0xFFFE0000\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC60DE4\n"
                "CMP     R5, #1\n"
                "LDMEQFD SP!, {R4-R6,PC}\n"
                "CMP     R5, #0\n"
                "BNE     loc_FFC60DE4\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC60DDC\n"
                "CMP     R1, R4,LSL#17\n"
                "TSTNE   R4, #0xC00\n"
                "BEQ     loc_FFC60DD8\n"
                "BL      sub_FFC62168_my\n"  //------>
                "B       loc_FFC60DDC\n"
"loc_FFC60DD8:\n"
                "BL      sub_FFC6211C\n"
"loc_FFC60DDC:\n"
                "BL      sub_FFC622E0\n"
                "B       loc_FFC60E9C\n"
"loc_FFC60DE4:\n"
                "CMP     R4, R2\n"
                "BEQ     loc_FFC60E94\n"
                "CMP     R1, R4,LSL#17\n"
                "LDRH    R0, [R6,#2]\n"
                "TSTNE   R4, #0xC00\n"
                "BEQ     loc_FFC60E44\n"
                "CMP     R0, R2\n"
                "BEQ     loc_FFC60E94\n"
                "CMP     R1, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC60E28\n"
                "LDR     R1, =0xFFC61060\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "CMP     R5, #1\n"
                "BEQ     loc_FFC60E6C\n"
                "B       loc_FFC60E3C\n"
"loc_FFC60E28:\n"
                "LDR     R1, =0xFFC61070\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "CMP     R5, #1\n"
                "BEQ     loc_FFC60E88\n"
"loc_FFC60E3C:\n"
                "BL      sub_FFC62168_my\n"  //------>
                "B       loc_FFC60E94\n"
"loc_FFC60E44:\n"
                "CMP     R0, R2\n"
                "BEQ     loc_FFC60E94\n"
                "CMP     R1, R0,LSL#17\n"
                "TSTNE   R0, #0xC00\n"
                "BEQ     loc_FFC60E74\n"
                "LDR     R1, =0xFFC61080\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC60E90\n"
"loc_FFC60E6C:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC62194\n"
"loc_FFC60E74:\n"
                "LDR     R1, =0xFFC61090\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC60E90\n"
"loc_FFC60E88:\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "B       sub_FFC62144\n"
"loc_FFC60E90:\n"
                "BL      sub_FFC6211C\n"
"loc_FFC60E94:\n"
                "CMP     R5, #0\n"
                "LDMNEFD SP!, {R4-R6,PC}\n"
"loc_FFC60E9C:\n"
                "STRH    R4, [R6,#2]\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC62168_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC622C0\n"
                "MOV     R0, #0x20\n"
                "BL      sub_FFC547F4\n"
                "LDR     R0, =0x5A10\n"
                "LDR     R0, [R0,#0x28]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC62BF8\n"
                "LDMFD   SP!, {R4,LR}\n"
                "MOV     R0, #0\n"
                "B       sub_FFC65110_my\n"  //----------->
 );
} 

//OK!

void __attribute__((naked,noinline)) sub_FFC65110_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R4, =0x5BC4\n"
                "MOV     R0, #0\n"
                "STR     R0, [R4,#0x30]\n"
                "LDR     R0, [R4,#8]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6513C\n"
                "LDR     R0, =sub_FFC64C84_my\n"  //----------->
                "MOV     R1, #0\n"
                "BL      sub_FFC5A938\n"
                "STR     R0, [R4,#8]\n"
"loc_FFC6513C:\n"
                "LDR     R0, [R4,#0xC]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC65158\n"
                "LDR     R0, =0xFFC64918\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC61DE4\n"
                "STR     R0, [R4,#0xC]\n"
"loc_FFC65158:\n"
                "BL      sub_FFC65940\n"
                "BL      sub_FFC6497C\n"
                "BL      sub_FFD383E8\n"
                "BL      sub_FFD391D4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD30AB0\n"

 );
} 


void __attribute__((naked,noinline)) sub_FFC64C84_my(){ 
 asm volatile(
                "STMFD   SP!, {R0-R11,LR}\n"
                "LDR     R5, =0x5BC4\n"
                "MOV     R4, R1\n"
                "LDR     R1, [R5,#0x2C]\n"
                "ADD     R0, R5, #0\n"
                "LDR     R0, [R0,#0x14]\n"
                "CMP     R1, #0\n"
                "SUB     SP, SP, #4\n"
                "MVN     R9, #0\n" 
                "BEQ     loc_FFC64D00\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC64F04\n"
                "CMP     R4, #0x800\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "LDREQ   R2, [R5,#0x38]\n"
                "CMPEQ   R1, R2\n"
                "BNE     loc_FFC650A4\n"
                "MOV     R1, #0\n"
                "STR     R1, [R5,#0x2C]!\n"
                "CMP     R0, #0\n"
                "STR     R9, [R5,#0xC]\n"
                "BNE     loc_FFC65108\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #1\n"
                "BEQ     loc_FFC64CF8\n"
                "BL      sub_FFC1A554\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC65108\n"
"loc_FFC64CF8:\n"
                "BL      sub_FFC64ACC\n"
                "B       loc_FFC65108\n"
"loc_FFC64D00:\n"
                "CMP     R0, #1\n"
                "SUBEQ   R12, R4, #0x2000\n"
                "SUBEQS  R12, R12, #0x1C\n"
                "BNE     loc_FFC64D1C\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC65414\n"
                "B       loc_FFC65108\n"
"loc_FFC64D1C:\n"
                "BL      sub_FFC59BE0\n"
                "LDR     R10, =0x9A5\n"
                "CMP     R0, #1\n"
                "SUB     R7, R10, #4\n"
                "SUB     R8, R10, #2\n"
                "BNE     loc_FFC64D50\n"
                "CMP     R4, R10\n"
                "CMPNE   R4, R7\n"
                "CMPNE   R4, R8\n"
                "BNE     loc_FFC64D50\n"
                "BL      sub_FFC58D84\n"
                "STR     R4, [R5,#0x3C]\n"
                "B       loc_FFC650A4\n"
"loc_FFC64D50:\n"
                "BL      sub_FFD2F8C0\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64D70\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC5AE78\n"
                "CMP     R0, #1\n"
                "CMPNE   R4, R10\n"
                "BEQ     loc_FFC650A4\n"
"loc_FFC64D70:\n"
                "BL      sub_FFC1A624\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64D88\n"
                "CMP     R4, R7\n"
                "CMPNE   R4, R8\n"
                "BEQ     loc_FFC65108\n"
"loc_FFC64D88:\n"
                "BL      sub_FFC61A44\n"
                "LDR     R1, =0x9A2\n"
                "CMP     R0, #1\n"
                "ADD     R11, R1, #2\n"
                "BNE     loc_FFC64DB0\n"
                "CMP     R4, R7\n"
                "CMPNE   R4, R1\n"
                "CMPNE   R4, R8\n"
                "CMPNE   R4, R11\n"
                "BEQ     loc_FFC65108\n"
"loc_FFC64DB0:\n"
                "LDR     R12, =0x200A\n"
                "MOV     R6, #1\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC64ED8\n"
                "BGT     loc_FFC64E34\n"
                "LDR     R12, =0x907\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #2\n"
                "MOVEQ   R0, R10\n"
                "BEQ     loc_FFC65044\n"
                "BGT     loc_FFC64E10\n"
                "SUB     R12, R4, #0x800\n"
                "LDR     R7, =0x2003\n"
                "SUBS    R12, R12, #0x26\n"
                "BEQ     loc_FFC64F1C\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x29\n"
                "BEQ     loc_FFC64F60\n"
                "CMP     R4, #0x860\n"
                "BEQ     loc_FFC64FB0\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x61\n"
                "BNE     loc_FFC650BC\n"
                "B       loc_FFC650A4\n"
"loc_FFC64E10:\n"
                "CMP     R4, R7\n"
                "BEQ     loc_FFC6503C\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC64ED8\n"
                "CMP     R4, R8\n"
                "BEQ     loc_FFC6503C\n"
                "CMP     R4, R11\n"
                "BNE     loc_FFC650BC\n"
                "B       loc_FFC64ED8\n"
"loc_FFC64E34:\n"
                "LDR     R12, =0x3149\n"
                "CMP     R4, R12\n"
                "MOVEQ   R1, #0\n"
                "MOVEQ   R0, #0x84\n"
                "BEQ     loc_FFC650B4\n"
                "BGT     loc_FFC64E90\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #0x20\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "MOVEQ   R0, #0x83\n"
                "BEQ     loc_FFC650B4\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC64EF4\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x35\n"
                "BEQ     loc_FFC64ECC\n"
                "SUB     R12, R4, #0x3000\n"
                "SUBS    R12, R12, #0x148\n"
                "BNE     loc_FFC650BC\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x86\n"
                "B       loc_FFC650B4\n"
"loc_FFC64E90:\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC650AC\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #3\n"
                "BEQ     loc_FFC65068\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #8\n"
                "BEQ     loc_FFC6504C\n"
                "SUB     R12, R4, #0x4000\n"
                "SUBS    R12, R12, #0xF\n"
                "BNE     loc_FFC650BC\n"
                "MOV     R0, #0x82\n"
                "BL      sub_FFC65F10\n"
                "B       loc_FFC65108\n"
"loc_FFC64ECC:\n"
                "BL      sub_FFC65974\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC64EE4\n"
"loc_FFC64ED8:\n"
                "LDR     R1, [SP,#0x38-0x28]\n"
                "MOV     R0, R4\n"
                "B       loc_FFC65034\n"
"loc_FFC64EE4:\n"
                "LDR     R0, [R5,#0x1C]\n"
                "CMP     R0, #0\n"
                "BLNE    sub_FFC64A14\n"
                "B       loc_FFC65108\n"
"loc_FFC64EF4:\n"
                "STR     R6, [R5,#0x1C]\n"
                "LDR     R0, [R5,#0x18]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64F10\n"
"loc_FFC64F04:\n"
                "BL      sub_FFC64A14\n"
"loc_FFC64F08:\n"
                "ADD     SP, SP, #0x14\n"
                "LDMFD   SP!, {R4-R11,PC}\n"
"loc_FFC64F10:\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC64BF4\n"
                "B       loc_FFC65108\n"
"loc_FFC64F1C:\n"
                "BL      sub_FFC61A44\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC64F34\n"
                "MOV     R0, R4\n"
                "BL      sub_FFC61FB4\n"
                "B       loc_FFC65108\n"
"loc_FFC64F34:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORR     R0, R0, R1\n"
                "LDR     R1, [R5,#0x1C]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC65108\n"
                "MOV     R1, #0\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC465F0\n"
                "BL      sub_FFD1F900\n"
                "B       loc_FFC65108\n"
"loc_FFC64F60:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BNE     loc_FFC65108\n"
                "BL      sub_FFC61FC0\n"
                "CMP     R0, #0\n"
                "LDREQ   R0, [R5,#0x1C]\n"
                "CMPEQ   R0, #0\n"
                "BNE     loc_FFC65108\n"
                "BL      sub_FFC61A44\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC65108\n"
                "BL      sub_FFD39284\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC65108\n"
                "MOV     R1, #0\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC465F0\n"
                "BL      sub_FFD1AB2C\n"
                "B       loc_FFC65108\n"
"loc_FFC64FB0:\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6500C\n"
                "BL      sub_FFC624B4\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64FD0\n"
"loc_FFC64FC8:\n"
                "MOV     R0, R6\n"
                "B       loc_FFC64F08\n"
"loc_FFC64FD0:\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6500C\n"
                "BL      sub_FFC65980\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64FC8\n"
                "LDR     R0, [R5,#0x44]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC6500C\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64FC8\n"
                "BL      sub_FFC1A554\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64FC8\n"
"loc_FFC6500C:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R8\n"
                "STR     R6, [R5,#0x44]\n"
                "BL      sub_FFC64B28_my\n"  //----------------->
                "MOV     R6, R0\n"
                "BL      sub_FFC65980\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64FC8\n"
                "MOV     R1, #0\n"
                "MOV     R0, R11\n"
"loc_FFC65034:\n"
                "BL      sub_FFC655E0_my\n"  //----------------->
                "B       loc_FFC64F08\n"
"loc_FFC6503C:\n"
                "MOV     R1, #1\n"
                "MOV     R0, R4\n"
"loc_FFC65044:\n"
                "BL      sub_FFC64B28_my\n"  //----------------->
                "B       loc_FFC64F08\n"
"loc_FFC6504C:\n"
                "LDR     R0, [SP,#0x38-0x28]\n"
                "BL      sub_FFC6070C\n"
                "CMP     R0, #0\n"
                "LDREQ   R1, [SP,#0x38-0x28]\n"
                "MOVEQ   R0, R4\n"
                "BLEQ    sub_FFC655E0_my\n"  //----------------->
                "B       loc_FFC650A4\n"
"loc_FFC65068:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMN     R0, #1\n"
                "BEQ     loc_FFC650A4\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC57E68\n"
                "LDR     R0, [R5,#0x3C]\n"
                "CMP     R0, R7\n"
                "BNE     loc_FFC65094\n"
                "BL      sub_FFC1A54C\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC650A0\n"
"loc_FFC65094:\n"
                "LDR     R0, [R5,#0x3C]\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5B0F4\n"
"loc_FFC650A0:\n"
                "STR     R9, [R5,#0x3C]\n"
"loc_FFC650A4:\n"
                "MOV     R0, #1\n"
                "B       loc_FFC64F08\n"
"loc_FFC650AC:\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x85\n"
"loc_FFC650B4:\n"
                "BL      sub_FFC65ED0\n"
                "B       loc_FFC65108\n"
"loc_FFC650BC:\n"
                "LDR     R12, =0x855\n"
                "CMP     R4, R12\n"
                "BEQ     loc_FFC650F8\n"
                "BGT     loc_FFC650E4\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x38\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x39\n"
                "BNE     loc_FFC64ED8\n"
                "B       loc_FFC650F8\n"
"loc_FFC650E4:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x56\n"
                "SUBNE   R12, R4, #0x800\n"
                "SUBNES  R12, R12, #0x5D\n"
                "BNE     loc_FFC64ED8\n"
"loc_FFC650F8:\n"
                "LDR     R0, [R5,#0x10]\n"
                "LDR     R1, [R5,#0x14]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC64ED8\n"
"loc_FFC65108:\n"
                "MOV     R0, #0\n"
                "B       loc_FFC64F08\n"
 );
} 

//OK!

void __attribute__((naked,noinline)) sub_FFC64B28_my(){
asm volatile(
                "STMFD   SP!, {R4-R6,LR}\n"
                "LDR     R6, =0x5BC4\n"
                "MOV     R4, R0\n"
                "LDR     R0, [R6,#0x1C]\n"
                "MOV     R5, R1\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0xFFC64C60\n"
                "BNE     loc_FFC64BD8\n"
                "BL      sub_FFC65980\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC64B64\n"
"loc_FFC64B54:\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R6,LR}\n"
                "MOV     R1, #0\n"
                "B       sub_FFC655E0_my\n"  //------------->
"loc_FFC64B64:\n"
                "CMP     R5, #2\n"
                "BNE     loc_FFC64B7C\n"
                "BL      sub_FFC640BC\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC64BC8\n"
                "B       loc_FFC64B90\n"
"loc_FFC64B7C:\n"
                "CMP     R5, #1\n"
                "BNE     loc_FFC64BC8\n"
                "BL      sub_FFC640D4\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64BC8\n"
"loc_FFC64B90:\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC57E68\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA1\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA3\n"
                "SUBNE   R12, R4, #0x900\n"
                "SUBNES  R12, R12, #0xA5\n"
                "LDREQ   R0, =0xC507\n"
                "MOVEQ   R1, #0\n"
                "BLEQ    sub_FFC465F0\n"
                "MOV     R0, #0\n"
                "STR     R0, [R6,#0x44]\n"
                "B       loc_FFC64BE0\n"
"loc_FFC64BC8:\n"
                "BL      sub_FFC64ACC\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC64BE8\n"
                "LDR     R1, =0xFFC64C70\n"
"loc_FFC64BD8:\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
"loc_FFC64BE0:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R6,PC}\n"
"loc_FFC64BE8:\n"
                "MOV     R0, R5\n"
                "BL      sub_FFD2E9A8\n"
                "B       loc_FFC64B54\n"
 );
}

void __attribute__((naked,noinline)) sub_FFC655E0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R7, R1\n"
                "MOV     R4, R0\n"
                "BL      sub_FFC659FC\n"
                "LDR     R5, =0x5C0C\n"
                "LDR     R3, =0x200A\n"
                "LDR     R12, [R5]\n"
                "LDR     R2, =0x4008\n"
                "LDR     R6, =0x9A3\n"
                "LDR     R0, =0x3007\n"
                "LDR     R1, =0x1051\n"
                "CMP     R12, #9\n"
                "ADD     LR, R3, #0x15\n"
                "ADDLS   PC, PC, R12,LSL#2\n"
                "B       loc_FFC65938\n"
"loc_FFC6561C:\n"
                "B       loc_FFC65644\n"
"loc_FFC65620:\n"
                "B       loc_FFC65654\n"
"loc_FFC65624:\n"
                "B       loc_FFC65664\n"
"loc_FFC65628:\n"
                "B       loc_FFC656D8\n"
"loc_FFC6562C:\n"
                "B       loc_FFC65718\n"
"loc_FFC65630:\n"
                "B       loc_FFC657A0\n"
"loc_FFC65634:\n"
                "B       loc_FFC657D0\n"
"loc_FFC65638:\n"
                "B       loc_FFC65880\n"
"loc_FFC6563C:\n"
                "B       loc_FFC65844\n"
"loc_FFC65640:\n"
                "B       loc_FFC658A8\n"
"loc_FFC65644:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC6555C\n"
"loc_FFC65654:\n"
                "MOV     R1, R7\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4-R8,LR}\n"
                "B       sub_FFC65B7C_my\n"  //------>
"loc_FFC65664:\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC656C8\n"
                "SUB     R12, R4, #0x2000\n"
                "SUBS    R12, R12, #6\n"
                "BEQ     loc_FFC6568C\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC656D0\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC65938\n"
"loc_FFC6568C:\n"
                "BL      sub_FFC64AA8\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC659E4\n"
                "LDR     R0, [R5,#8]\n"
                "CMP     R0, #0\n"
                "MOVNE   R1, #0\n"
                "MOVNE   R0, R6\n"
                "BNE     loc_FFC656C0\n"
                "LDR     R0, [R5,#4]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC658E8\n"
                "LDR     R0, =0x9A1\n"
                "MOV     R1, #0\n"
"loc_FFC656C0:\n"
                "BL      sub_FFC6555C\n"
                "B       loc_FFC658E8\n"
"loc_FFC656C8:\n"
                "BL      sub_FFC65AF0\n"
                "B       loc_FFC658E8\n"
"loc_FFC656D0:\n"
                "BL      sub_FFC65B08\n"
                "B       loc_FFC658E8\n"
"loc_FFC656D8:\n"
                "SUB     R12, R4, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC65708\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC65700\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC65710\n"
                "CMP     R4, R0\n"
                "BLEQ    sub_FFC65B08\n"
                "B       loc_FFC65938\n"
"loc_FFC65700:\n"
                "BL      sub_FFC65500_my\n"  //------>
                "B       loc_FFC65938\n"
"loc_FFC65708:\n"
                "BL      sub_FFC65ACC\n"
                "B       loc_FFC65938\n"
"loc_FFC65710:\n"
                "BL      sub_FFC65AF0\n"
                "B       loc_FFC65938\n"
"loc_FFC65718:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC65774\n"
                "BGT     loc_FFC65740\n"
                "CMP     R4, R6\n"
                "BEQ     loc_FFC6575C\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC6578C\n"
"loc_FFC65734:\n"
                "CMP     R4, R3\n"
                "BNE     loc_FFC65938\n"
                "B       loc_FFC65750\n"
"loc_FFC65740:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC65780\n"
"loc_FFC65748:\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC65938\n"
"loc_FFC65750:\n"
                "BL      sub_FFC65B58\n"
                "BL      sub_FFC65ACC\n"
                "B       loc_FFC658E8\n"
"loc_FFC6575C:\n"
                "BL      sub_FFC16B94\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC659E4\n"
                "MOV     R0, #0\n"
                "STR     R0, [R5,#0xC]\n"
                "B       loc_FFC658E8\n"
"loc_FFC65774:\n"
                "MOV     R0, #5\n"
                "BL      sub_FFC659E4\n"
                "B       loc_FFC657C4\n"
"loc_FFC65780:\n"
                "BL      sub_FFC16B94\n"
                "BL      sub_FFC65B58\n"
                "B       loc_FFC65878\n"
"loc_FFC6578C:\n"
                "BL      sub_FFC16B94\n"
                "BL      sub_FFC65B58\n"
                "B       loc_FFC657D8\n"
"loc_FFC65798:\n"
                "BL      sub_FFC659E4\n"
                "B       loc_FFC658E8\n"
"loc_FFC657A0:\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC657C4\n"
                "BGT     loc_FFC657B8\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC65734\n"
                "B       loc_FFC657D8\n"
"loc_FFC657B8:\n"
                "CMP     R4, R0\n"
                "BNE     loc_FFC65748\n"
                "B       loc_FFC65878\n"
"loc_FFC657C4:\n"
                "MOV     R0, R7\n"
                "BL      sub_FFC65B24\n"
                "B       loc_FFC658E8\n"
"loc_FFC657D0:\n"
                "CMP     R4, R1\n"
                "BNE     loc_FFC65938\n"
"loc_FFC657D8:\n"
                "MOV     R0, #8\n"
                "B       loc_FFC65798\n"
"loc_FFC65844:\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC65878\n"
                "BGT     loc_FFC65864\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC656C8\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC657C4\n"
                "B       loc_FFC65938\n"
"loc_FFC65864:\n"
                "CMP     R4, R2\n"
                "SUBNE   R12, R4, #0x4000\n"
                "SUBNES  R12, R12, #0xE\n"
                "BEQ     loc_FFC656C8\n"
                "B       loc_FFC65938\n"
"loc_FFC65878:\n"
                "MOV     R0, #7\n"
                "B       loc_FFC65798\n"
"loc_FFC65880:\n"
                "CMP     R4, R3\n"
                "BEQ     loc_FFC65898\n"
                "CMP     R4, LR\n"
                "BEQ     loc_FFC657C4\n"
                "CMP     R4, R2\n"
                "BNE     loc_FFC65938\n"
"loc_FFC65898:\n"
                "BL      sub_FFC65ACC\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC64BF4\n"
                "B       loc_FFC658E8\n"
"loc_FFC658A8:\n"
                "SUB     R12, R4, #0x800\n"
                "SUBS    R12, R12, #0x4A\n"
                "BEQ     loc_FFC658F0\n"
                "CMP     R4, R1\n"
                "BEQ     loc_FFC65928\n"
                "CMP     R4, R0\n"
                "BEQ     loc_FFC65918\n"
                "SUB     R12, R4, #0x3100\n"
                "SUBS    R12, R12, #0x2A\n"
                "BNE     loc_FFC65938\n"
                "BL      sub_FFC65A84\n"
                "LDR     R0, [R5,#0x14]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC658E8\n"
                "BL      sub_FFC65AA0_my\n"  //---------------->
                "BL      sub_FFD2F8CC\n"
"loc_FFC658E8:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC658F0:\n"
                "BL      sub_FFC65A84\n"
                "LDR     R0, =0x8007\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC5C3C8\n"
                "BL      sub_FFD2E95C\n"
                "BL      sub_FFC65ACC\n"
                "BL      sub_FFD2F8CC\n"
                "BL      sub_FFC64AA8\n"
                "MOV     R0, #0\n"
                "B       loc_FFC65798\n"
"loc_FFC65918:\n"
                "BL      sub_FFC65A84\n"
                "BL      sub_FFD2E95C\n"
                "BL      sub_FFD2F8CC\n"
                "B       loc_FFC656D0\n"
"loc_FFC65928:\n"
                "BL      sub_FFC65A84\n"
                "BL      sub_FFD2E95C\n"
                "BL      sub_FFD2F8CC\n"
                "B       loc_FFC656C8\n"
"loc_FFC65938:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
                ".ltorg\n"  
 );
} 

void __attribute__((naked,noinline)) sub_FFC65B7C_my(){ 
 asm volatile(
                "LDR     R3, =0x5C0C\n"
                "LDR     R12, =0x2006\n"
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, [R3,#0xC]\n"
                "LDR     R2, [R3,#0x14]\n"
                "CMP     R0, R12\n"
                "BEQ     loc_FFC65BF0\n"
                "BGT     loc_FFC65BBC\n"
                "SUB     R12, R0, #0x900\n"
                "SUBS    R12, R12, #0xA2\n"
                "BEQ     loc_FFC65C14\n"
                "SUB     R12, R0, #0x1000\n"
                "SUBS    R12, R12, #0x51\n"
                "BNE     loc_FFC65C38\n"
                "BL      sub_FFC65AF0\n"
                "B       loc_FFC65C30\n"
"loc_FFC65BBC:\n"
                "SUB     R12, R0, #0x3000\n"
                "SUBS    R12, R12, #7\n"
                "BEQ     loc_FFC65C2C\n"
                "SUB     R12, R0, #0x3100\n"
                "SUBS    R12, R12, #0x4B\n"
                "BNE     loc_FFC65C38\n"
                "CMP     R2, #0\n"
                "BNE     loc_FFC65C30\n"
                "LDR     R0, [R3,#8]\n"
                "ORRS    R0, R0, R1\n"
                "BEQ     loc_FFC65BFC\n"
                "BL      sub_FFC65500_my\n"  //------------>
                "B       loc_FFC65C30\n"
"loc_FFC65BF0:\n"
                "CMP     R2, #0\n"
                "BLEQ    sub_FFC640F4\n"
                "B       loc_FFC65C30\n"
"loc_FFC65BFC:\n"
                "LDR     R0, [R3,#4]\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #3\n"
                "BNE     loc_FFC65C24\n"
                "BL      sub_FFC65ACC\n"
                "B       loc_FFC65C30\n"
"loc_FFC65C14:\n"
                "CMP     R1, #0\n"
                "BNE     loc_FFC65C30\n"
                "BL      sub_FFC1674C\n"
                "MOV     R0, #2\n"
"loc_FFC65C24:\n"
                "BL      sub_FFC659E4\n"
                "B       loc_FFC65C30\n"
"loc_FFC65C2C:\n"
                "BL      sub_FFC65B08\n"
"loc_FFC65C30:\n"
                "MOV     R0, #0\n"
                "LDMFD   SP!, {R4,PC}\n"
"loc_FFC65C38:\n"
                "MOV     R0, #1\n"
                "LDMFD   SP!, {R4,PC}\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC65500_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC657E0\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "LDR     R4, =0x5C0C\n"
                "LDR     R0, [R4,#0x10]\n"
                "CMP     R0, #0\n"
                "LDMEQFD SP!, {R4,LR}\n"
                "BEQ     sub_FFC65AA0_my\n"  //------------->
                "LDR     R1, =0xFFC657FC\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "BL      sub_FFD2F8F8\n"
                "LDR     R0, [R4,#0x18]\n"
                "CMP     R0, #1\n"
                "MOVNE   R0, #1\n"
                "STRNE   R0, [R4,#0x18]\n"
                "BLNE    sub_FFC5BA84\n"
                "MOV     R0, #9\n"
                "BL      sub_FFC659E4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFD2E818\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC65AA0_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "LDR     R1, =0xFFC65C58\n"
                "MOV     R0, #0x60\n"
                "BL      sub_FFC547F4\n"
                "LDR     R1, =0x5C0C\n"
                "MOV     R0, #0\n"
                "STR     R0, [R1,#0xC]\n"
                "MOV     R0, #4\n"
                "BL      sub_FFC659E4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC651B0_my\n" //------------->
 );
} 

void __attribute__((naked,noinline)) sub_FFC651B0_my(){ 
 asm volatile(
                "LDR     R0, =0x5BC4\n"
                "STMFD   SP!, {R3,LR}\n"
                "LDR     R1, [R0,#0x40]\n"
                "CMP     R1, #1\n"
                "MOVNE   R1, #1\n"
                "STRNE   R1, [R0,#0x40]\n"
                "BLNE    sub_FFC5BA84\n"
                "MOV     R1, #0\n"
                "MOV     R0, #0x80\n"
                "BL      sub_FFC65ED0\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0x6B\n"
                "BL      sub_FFC57424\n"
                "MOV     R2, #2\n"
                "MOV     R1, SP\n"
                "MOV     R0, #0xA3\n"
                "BL      sub_FFC57324\n"
                "BL      sub_FFC466B0\n"
                "BL      sub_FFC643B8\n"
                "BL      sub_FFC16B64_my\n"  //---------------->
                "BL      sub_FFC64A60\n"
                "LDMFD   SP!, {R12,PC}\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC16B64_my(){ 
 asm volatile(
                "STMFD   SP!, {R4,LR}\n"
                "MOV     R4, R0\n"
                "MOV     R0, #0x20\n"
                "LDR     R1, =0xFFC16C84\n"
                "BL      sub_FFC547F4\n"
                "BL      sub_FFC16FB8\n"
                "CMP     R0, #0\n"
                "LDMNEFD SP!, {R4,PC}\n"
                "BL      sub_FFC47CEC\n"
                "MOV     R0, R4\n"
                "LDMFD   SP!, {R4,LR}\n"
                "B       sub_FFC49DE4_my\n"  //----------------->
 );
} 

//OK!

void __attribute__((naked,noinline)) sub_FFC49DE4_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "MOV     R8, R0\n"
                "MOV     R0, #0x41\n"
                "SUB     SP, SP, #0x38\n"
                "MOV     R5, #0\n"
                "STR     R0, [SP,#0x50-0x1C]\n"
                "BL      sub_FFC49DB4\n"
                "CMP     R0, #0\n"
                "LDRNE   R1, =0x163\n"
                "BNE     loc_FFC49F90\n"
                "LDR     R4, =0x5334\n"
                "MOV     R1, #0x5E\n"
                "LDR     R0, [R4,#8]\n"
                "BL      sub_FFC173EC\n"
                "BL      sub_FFC575B4\n"
                "STR     R0, [R4,#4]\n"
                "MOV     R0, #0\n"
                "BL      sub_FFC513F8\n"
                "STR     R0, [SP,#0x50-0x28]\n"
                "ADD     R0, SP, #0x50-0x28\n"
                "MOV     R1, SP\n"
                "BL      sub_FFC51544\n"
                "MOV     R0, SP\n"
                "BL      sub_FFC5142C\n"
                "STR     R0, [SP,#0x50-0x24]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x34\n"
                "BL      sub_FFC578C8\n"
                "LDR     R7, [SP,#0x50-0x24]\n"
                "BL      sub_FFC4A2D4\n"
                "MOV     R6, #0\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "STR     R6, [SP,#0x50-0x24]\n"
                "STR     R6, [SP,#0x50-0x28]\n"
                "BL      sub_FFC1F6F8\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x2F\n"
                "BL      sub_FFC578C8\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "MOV     R1, #0x2D\n"
                "BL      sub_FFC578C8\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "BL      sub_FFC23058\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0x30\n"
                "BL      sub_FFC578C8\n"
                "ADD     R1, SP, #0x50-0x28\n"
                "ADD     R0, SP, #0x50-0x24\n"
                "BL      sub_FFC1FED0\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "MOV     R1, #0x2E\n"
                "BL      sub_FFC578C8\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #2\n"
                "ADD     R2, SP, #0x50-0x24\n"
                "MOV     R1, #0xB8\n"
                "BL      sub_FFC57974\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x142\n"
                "LDRNE   R0, =0xFFC4A208\n"
                "BLNE    sub_FFC0BDB8\n"
                "LDRH    R0, [SP,#0x50-0x24]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x28\n"
                "CMP     R0, #0\n"
                "MOVNE   R0, #1\n"
                "STR     R0, [SP,#0x50-0x28]\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R1, #0x92\n"
                "BL      sub_FFC578C8\n"
                "MOV     R2, #1\n"
                "ADD     R1, SP, #0x50-0x1C\n"
                "MOV     R0, #0xFA\n"
                "BL      sub_FFC57424\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x17A\n"
                "LDRNE   R0, =0xFFC4A208\n"
                "BLNE    sub_FFC0BDB8\n"
                "LDRB    R0, [SP,#0x50-0x1C]\n"
                "MOV     R3, R8\n"
                "MOV     R2, #0x14\n"
                "AND     R1, R0, #0xFF\n"
                "ADD     R0, SP, #0x50-0x20\n"
                "STR     R7, [SP,#0x50-0x50]\n"
                "BL      sub_FFCEA074\n"
                "TST     R0, #1\n"
                "LDRNE   R1, =0x17E\n"
                "BNE     loc_FFC49F90\n"
                "LDR     R0, =0x196AC\n"
                "LDR     R1, [SP,#0x50-0x20]\n"
                "MOV     R2, #0x10\n"
                "BL      sub_FFCDCF18\n"
                "TST     R0, #1\n"
                "BEQ     loc_FFC49FA0\n"
                "LDR     R1, =0x186\n"
"loc_FFC49F90:\n"
                "LDR	 R0, =0xFFC4A208\n"
                "BL		 sub_FFC0BDB8\n"
"loc_FFC49F98:\n"
                "ADD     SP, SP, #0x38\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC49FA0:\n"
                "LDR     R0, [R4,#4]\n"
                "MOV     R3, #4\n"
                "ADD     R2, SP, #0x50-0x20\n"
                "MOV     R1, #0x2B\n"
                "BL      sub_FFC578C8\n"
                "BL      sub_FFC660B4\n"
                "LDRSB   R1, [SP,#0x50-0x1C]\n"
                "CMP     R0, R1\n"
                "MOVEQ   R7, #0\n"
                "BEQ     loc_FFC49FF4\n"
                "LDR     R5, =0x196AC\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC66230\n"
                "MOV     R8, R0\n"
                "BL      sub_FFC94BB4\n"
                "CMP     R8, R0\n"
                "MOV     R7, R0\n"
                "LDRLS   R1, =0x193\n"
                "LDRLS   R0, =0xFFC4A208\n"
                "BLLS    sub_FFC0BDB8\n"
                "SUB     R7, R8, R7\n"
"loc_FFC49FF4:\n"
                "BL      sub_FFC459FC_my\n"  //----------------------->
                "LDR     R0, =0x196D0\n"
                "LDRH    R3, [R0,#0x46]\n"
                "LDRH    R2, [R0,#0x44]\n"
                "LDR     R1, [R0,#0x40]\n"
                "LDR     R0, [R0,#0x3C]\n"
                "BL      sub_FFC44A7C\n"
                "MOV     R3, #0\n"
                "LDR     R2, =0xFFC49D7C\n"
                "MOV     R1, #0\n"
                "LDR     R0, =0xFFC49D90\n"
                "ADD     R8, SP, #0x50-0x44\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R2, =0xFFC49DA0\n"
                "LDR     R1, =0xFFC49D8C\n"
                "STMEA   SP, {R1-R3}\n"
                "LDR     R1, [R4,#4]\n"
                "MOV     R3, R6\n"
                "MOV     R2, R7\n"
                "MOV     R0, R5\n"
                "BL      sub_FFC44DD8\n"
                "LDR     R0, [R4,#8]\n"
                "MOV     R1, #0x20\n"
                "BL      sub_FFC173B8\n"
                "B       loc_FFC49F98\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFC459FC_my(){ 
 asm volatile(
                "STMFD   SP!, {R3-R9,LR}\n"
                "LDR     R5, =0x51C8\n"
                "MOV     R6, #0\n"
                "STR     R6, [R5,#0x20]\n"
                "LDR     R0, [R5,#4]\n"
                "LDR     R8, =0x2710\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC45AB4\n"
                "MOV     R0, #1\n"
                "STR     R0, [R5,#4]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BC34\n"
                "STR     R0, [R5,#0x10]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0\n"
                "BL      sub_FFC0BC34\n"
                "STR     R0, [R5,#0x14]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BBEC\n"
                "STR     R0, [R5,#0x18]\n"
                "MOV     R0, #0\n"
                "MOV     R1, #0xA\n"
                "BL      sub_FFC0BBEC\n"
                "LDR     R7, =0x192C0\n"
                "MOV     R4, #9\n"
                "ADD     R9, R4, #0x2D4\n"
                "STR     R0, [R5,#0x1C]\n"
"loc_FFC45A70:\n"
                "RSB     R0, R4, R4,LSL#3\n"
                "STR     R6, [R7,R0,LSL#2]\n"
                "ADD     R1, R7, R0,LSL#2\n"
                "STR     R9, [SP,#0x20-0x20]\n"
                "LDR     R0, [R5,#0x1C]\n"
                "LDR     R3, =0xFFC44D78\n"
                "MOV     R2, R8\n"
                "BL      sub_FFC0BCF8\n"
                "SUBS    R4, R4, #1\n"
                "BPL     loc_FFC45A70\n"
                "MOV     R3, #0\n"
                "STR     R3, [SP,#0x20-0x20]\n"
                "LDR     R3, =MovieRecord_Task_my\n"  // ----------------->
                "MOV     R2, #0x1000\n"
                "MOV     R1, #0x14\n"
                "LDR     R0, =0xFFC45C04\n"
                "BL      sub_FFC0BBB8\n"
"loc_FFC45AB4:\n"
                "BL      sub_FFD08668\n"
                "BL      sub_FFC45B18\n"
                "MOV     R1, R0\n"
                "MOV     R0, #0xB\n"
                "ADD     R3, R0, #0x2DC\n"
                "STR     R0, [R1]\n"
                "STR     R3, [SP,#0x20-0x20]\n"
                "LDR     R3, =0xFFC44D78\n"
                "MOV     R2, R8\n"
                "LDR     R0, [R5,#0x18]\n"
                "BL      sub_FFC0BCF8\n"
                "LDMFD   SP!, {R3-R9,PC}\n"
 );
} 

void __attribute__((naked,noinline)) MovieRecord_Task_my(){ 
 asm volatile(
                "STMFD   SP!, {R2-R8,LR}\n"
                "LDR     R8, =0x32B\n"
                "LDR     R7, =0x2710\n"
                "LDR     R4, =0x51C8\n"
                "MOV     R6, #0\n"
                "MOV     R5, #1\n"
"loc_FFC4590C:\n"
                "LDR     R0, [R4,#0x18]\n"
                "MOV     R2, #0\n"
                "ADD     R1, SP, #0x20-0x1C\n"
                "BL      sub_FFC1763C\n"
                "LDR     R0, [R4,#0x20]\n"
                "CMP     R0, #0\n"
                "BNE     loc_FFC459DC\n"
                "LDR     R0, [SP,#0x20-0x1C]\n"
                "LDR     R1, [R0]\n"
                "SUB     R1, R1, #2\n"
                "CMP     R1, #9\n"
                "ADDLS   PC, PC, R1,LSL#2\n"
                "B       loc_FFC459DC\n"
"loc_FFC45940:\n"
                "B       loc_FFC45990\n"
"loc_FFC45944:\n"
                "B       loc_FFC459B0\n"
"loc_FFC45948:\n"
                "B       loc_FFC459C0\n"
"loc_FFC4594C:\n"
                "B       loc_FFC459C8\n"
"loc_FFC45950:\n"
                "B       loc_FFC45998\n"
"loc_FFC45954:\n"
                "B       loc_FFC459D0\n"
"loc_FFC45958:\n"
                "B       loc_FFC459A0\n"
"loc_FFC4595C:\n"
                "B       loc_FFC459DC\n"
"loc_FFC45960:\n"
                "B       loc_FFC459D8\n"
"loc_FFC45964:\n"
                "B       loc_FFC45968\n"
"loc_FFC45968:\n"
                "LDR     R0, =0xFFC455F0\n"
                "STR     R6, [R4,#0x34]\n"
                "STR     R0, [R4,#0xA0]\n"
                "LDR     R0, =0xFFC45068\n"
                "LDR     R2, =0xFFC44F84\n"
                "LDR     R1, =0x193E8\n"
                "STR     R6, [R4,#0x24]\n"
                "BL      sub_FFCA1774\n"
                "STR     R5, [R4,#0x38]\n"
                "B       loc_FFC459DC\n"
"loc_FFC45990:\n"
				"BL      unlock_optical_zoom\n" //  +
                "BL      sub_FFC456E8\n"
                "B       loc_FFC459DC\n"
"loc_FFC45998:\n"
                "BL      sub_FFC453F0_my\n"  //------------------->
                "B       loc_FFC459DC\n"
"loc_FFC459A0:\n"
                "LDR     R1, [R0,#0x10]\n"
                "LDR     R0, [R0,#4]\n"
                "BL      sub_FFD09274\n"
                "B       loc_FFC459DC\n"
"loc_FFC459B0:\n"
                "LDR     R0, [R4,#0x38]\n"
                "CMP     R0, #5\n"
                "STRNE   R5, [R4,#0x28]\n"
                "B       loc_FFC459DC\n"
"loc_FFC459C0:\n"
                "BL      sub_FFC451F8\n"
                "B       loc_FFC459DC\n"
"loc_FFC459C8:\n"
                "BL      sub_FFC450B4\n"
                "B       loc_FFC459DC\n"
"loc_FFC459D0:\n"
                "BL      sub_FFC44F10\n"
                "B       loc_FFC459DC\n"
"loc_FFC459D8:\n"
                "BL      sub_FFC45B44\n"
"loc_FFC459DC:\n"
                "LDR     R1, [SP,#0x20-0x1C]\n"
                "LDR     R3, =0xFFC44D78\n"
                "STR     R6, [R1]\n"
                "STR     R8, [SP,#0x20-0x20]\n"
                "LDR     R0, [R4,#0x1C]\n"
                "MOV     R2, R7\n"
                "BL      sub_FFC0BCF8\n"
                "B       loc_FFC4590C\n"
 );
} 

void __attribute__((naked,noinline)) sub_FFC453F0_my(){ 
 asm volatile(                                   	
                "STMFD   SP!, {R4-R8,LR}\n"
                "SUB     SP, SP, #0x40\n"
                "MOV     R6, #0\n"
                "LDR     R5, =0x51C8\n"
                "MOV     R4, R0\n"
                "STR     R6, [SP,#0x58-0x28]\n"
                "STR     R6, [SP,#0x58-0x30]\n"
                "LDR     R0, [R5,#0x38]\n"
                "MOV     R8, #4\n"
                "CMP     R0, #3\n"
                "STREQ   R8, [R5,#0x38]\n"
                "LDR     R0, [R5,#0xA0]\n"
                //"BLX     R0\n"
				".long   0xE12FFF30\n"
                "LDR     R0, [R5,#0x38]\n"
                "CMP     R0, #4\n"
                "BNE     loc_FFC454C8\n"
                "ADD     R3, SP, #0x58-0x30\n"
                "ADD     R2, SP, #0x58-0x30+4\n"
                "ADD     R1, SP, #0x58-0x28\n"
                "ADD     R0, SP, #0x58-0x24\n"
                "BL      sub_FFD09408\n"
                "CMP     R0, #0\n"
                "MOV     R7, #1\n"
                "BNE     loc_FFC4546C\n"
                "LDR     R1, [R5,#0x28]\n"
                "CMP     R1, #1\n"
                "BNE     loc_FFC454D0\n"
                "LDR     R1, [R5,#0x50]\n"
                "LDR     R2, [R5,#0x3C]\n"
                "CMP     R1, R2\n"
                "BCC     loc_FFC454D0\n"
"loc_FFC4546C:\n"
                "CMP     R0, #0x80000001\n"
                "STREQ   R8, [R5,#0x54]\n"
                "BEQ     loc_FFC454A4\n"
                "CMP     R0, #0x80000003\n"
                "STREQ   R7, [R5,#0x54]\n"
                "BEQ     loc_FFC454A4\n"
                "CMP     R0, #0x80000005\n"
                "MOVEQ   R0, #2\n"
                "BEQ     loc_FFC454A0\n"
                "CMP     R0, #0x80000007\n"
                "STRNE   R6, [R5,#0x54]\n"
                "BNE     loc_FFC454A4\n"
                "MOV     R0, #3\n"
"loc_FFC454A0:\n"
                "STR     R0, [R5,#0x54]\n"
"loc_FFC454A4:\n"
                "LDR     R0, =0x19418\n"
                "LDR     R0, [R0,#8]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC454BC\n"
                "BL      sub_FFC31FCC\n"
                "B       loc_FFC454C0\n"
"loc_FFC454BC:\n"
                "BL      sub_FFC44F10\n"
"loc_FFC454C0:\n"
                "MOV     R0, #5\n"
                "STR     R0, [R5,#0x38]\n"
"loc_FFC454C8:\n"
                "ADD     SP, SP, #0x40\n"
                "LDMFD   SP!, {R4-R8,PC}\n"
"loc_FFC454D0:\n"
                "LDR     LR, [SP,#0x58-0x28]\n"
                "CMP     LR, #0\n"
                "BEQ     loc_FFC45598\n"
                "STR     R7, [R5,#0x2C]\n"
                "LDR     R0, [R5,#0x6C]\n"
                "LDR     R1, [R4,#0x14]\n"
                "LDR     R2, [R4,#0x18]\n"
                "LDR     R12, [R4,#0xC]\n"
                "ADD     R3, SP, #0x58-0x20\n"
                "ADD     R8, SP, #0x58-0x44\n"
                "STMIA   R8, {R0-R3}\n"
                "LDR     R3, [R5,#0x58]\n"
                "ADD     R2, SP, #0x58-0x1C\n"
                "ADD     R8, SP, #0x58-0x50\n"
                //"LDRD    R0, [SP,#0x58-0x30]\n"
				".long   0xE1CD02D8\n"
                "STMIA   R8, {R0,R2,R3}\n"
                "STR     R1, [SP,#0x58-0x54]\n"
                "STR     LR, [SP,#0x58-0x58]\n"
                "LDMIB   R4, {R0,R1}\n"
                "LDR     R3, [SP,#0x58-0x24]\n"
                "MOV     R2, R12\n"
                "BL      sub_FFCC87C4\n"
                "LDR     R0, [R5,#0x10]\n"
                "MOV     R1, #0x3E8\n"
                "BL      sub_FFC0B774\n"
                "CMP     R0, #9\n"
                "BNE     loc_FFC4554C\n"
                "BL      sub_FFD099E4\n"
                "MOV     R0, #0x90000\n"
                "STR     R7, [R5,#0x38]\n"
                "B       loc_FFC45564\n"
"loc_FFC4554C:\n"
                "LDR     R0, [SP,#0x58-0x20]\n"
                "CMP     R0, #0\n"
                "BEQ     loc_FFC4556C\n"
                "BL      sub_FFD099E4\n"
                "MOV     R0, #0xA0000\n"
                "STR     R7, [R5,#0x38]\n"
"loc_FFC45564:\n"
                "BL      sub_FFC5BD20\n"
                "B       loc_FFC454C8\n"
"loc_FFC4556C:\n"
                "BL      sub_FFCC8888\n"
                "LDR     R0, [SP,#0x58-0x24]\n"
                "LDR     R1, [SP,#0x58-0x1C]\n"
                "BL      sub_FFD0978C\n"
                "LDR     R0, [R5,#0x4C]\n"
                "LDR     R1, =0x5234\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x4C]\n"
                "LDR     R0, [SP,#0x58-0x1C]\n"
                "MOV     R2, #0\n"
                "BL      sub_FFD0761C_my\n"  //----------------->
"loc_FFC45598:\n"
                "LDR     R0, [R5,#0x50]\n"
                "ADD     R0, R0, #1\n"
                "STR     R0, [R5,#0x50]\n"
                "LDR     R1, [R5,#0x78]\n"
                "MUL     R0, R1, R0\n"
                "LDR     R1, [R5,#0x74]\n"
                "BL      sub_FFE50550\n"
                "MOV     R4, R0\n"
                "BL      sub_FFD09A1C\n"
                "LDR     R1, [R5,#0x70]\n"
                "CMP     R1, R4\n"
                "BNE     loc_FFC455D4\n"
                "LDR     R0, [R5,#0x30]\n"
                "CMP     R0, #1\n"
                "BNE     loc_FFC455E8\n"
"loc_FFC455D4:\n"
                "LDR     R1, [R5,#0x84]\n"
                "MOV     R0, R4\n"
                //"BLX     R1\n"
				".long   0xE12FFF31\n"
                "STR     R4, [R5,#0x70]\n"
                "STR     R6, [R5,#0x30]\n"
"loc_FFC455E8:\n"
                "STR     R6, [R5,#0x2C]\n"
                "B       loc_FFC454C8\n"
 );
} 


void __attribute__((naked,noinline)) sub_FFD0761C_my(){ 
 asm volatile(
                "STMFD   SP!, {R4-R8,LR}\n"
                "LDR     R4, =0x8404\n"
                "LDR     LR, [R4]\n"
                "LDR     R2, [R4,#8]\n"
                "CMP     LR, #0\n"
                "LDRNE   R3, [R4,#0xC]\n"
                "MOV     R5, R2\n"
                "CMPNE   R3, #1\n"
                "MOVEQ   R2, #0\n"
                "STREQ   R0, [R4]\n"
                "STREQ   R2, [R4,#0xC]\n"
                "BEQ     loc_FFD076E8\n"
                "LDR     R3, [R4,#4]\n"
                //"LDR     R7, =FFE6C4C0\n"
				"LDR     R7, =table\n"          // *
                "ADD     R12, R3, R3,LSL#1\n"
                "LDR     R3, [R7,R12,LSL#2]\n"
                "ADD     R6, R7, #0x30\n"
                "LDR     R8, [R6,R12,LSL#2]\n"
                "SUB     R3, LR, R3\n"
                "CMP     R3, #0\n"
                "SUB     LR, LR, R8\n"
                "BLE     loc_FFD076A4\n"
                "ADD     R12, R7, R12,LSL#2\n"
                "LDR     LR, [R12,#4]\n"
                "CMP     LR, R3\n"
                "ADDGE   R2, R2, #1\n"
                "BGE     loc_FFD07698\n"
                "LDR     R12, [R12,#8]\n"
                "CMP     R12, R3\n"
                "ADDLT   R2, R2, #3\n"
                "ADDGE   R2, R2, #2\n"
"loc_FFD07698:\n"
                //"CMP     R2, #0x17\n"
                //"MOVGE   R2, #0x16\n"
                "CMP     R2, #0x1A\n"   // +
                "MOVGE   R2, #0x19\n"   // +
                "B       loc_FFD076D8\n"
"loc_FFD076A4:\n"
                "CMP     LR, #0\n"
                "BGE     loc_FFD076D8\n"
                "ADD     R3, R6, R12,LSL#2\n"
                "LDR     R12, [R3,#4]\n"
                "CMP     R12, LR\n"
                "SUBLE   R2, R2, #1\n"
                "BLE     loc_FFD076D0\n"
                "LDR     R3, [R3,#8]\n"
                "CMP     R3, LR\n"
                "SUBGT   R2, R2, #3\n"
                "SUBLE   R2, R2, #2\n"
"loc_FFD076D0:\n"
                "CMP     R2, #0\n"
                "MOVLT   R2, #0\n"
"loc_FFD076D8:\n"
                "CMP     R2, R5\n"
                "STRNE   R2, [R4,#8]\n"
                "MOVNE   R2, #1\n"
                "STRNE   R2, [R4,#0xC]\n"
"loc_FFD076E8:\n"
                //"LDR     R2, =FFE6C464\n"
				"LDR     R2, =CompressionRateTable\n"   // *
                "LDR     R3, [R4,#8]\n"
                "LDR     R2, [R2,R3,LSL#2]\n"
				
				"LDR     R3, =video_mode\n"      // +
                "LDR     R3, [R3]\n"             // +
                "LDR     R3, [R3]\n"             // +
                "CMP     R3, #1\n"               // +
                "LDREQ   R3, =video_quality\n"   // +     
                "LDREQ   R3, [R3]\n"             // +     
                "LDREQ   R2, [R3]\n"             // +    
				
                "STR     R2, [R1]\n"
                "STR     R0, [R4]\n"
				"BL      mute_on_zoom\n"     // +
                "LDMFD   SP!, {R4-R8,PC}\n"
 );
} 

#include "conf.h"

int *video_quality = &conf.video_quality;
int *video_mode    = &conf.video_mode;

long def_table[24]={0x2000, 0x38D, 0x788, 0x5800, 0x9C5, 0x14B8, 0x10000, 0x1C6A, 0x3C45, 0x8000, 0xE35, 0x1E23,
           0x1CCD, -0x2E1, -0x579, 0x4F33, -0x7EB, -0xF0C, 0xE666, -0x170A, -0x2BC6, 0x7333, -0xB85, -0x15E3};

long table[24];

void change_video_tables(int a, int b){
 int i;
 for (i=0;i<24;i++) table[i]=(def_table[i]*a)/b; 
}

long CompressionRateTable[]={0x60, 0x5D, 0x5A, 0x57, 0x54, 0x51, 0x4D, 0x48, 0x42, 0x3B, 0x32, 0x29, 0x22, 0x1D, 0x17, 0x14, 0x10, 0xE, 0xB, 9, 7, 6, 5, 4, 3, 2, 1};
